<template>
	<uni-list class="my-list" v-if="newsArr.length">
		<uni-list-item v-for="(news,newsIndex) in newsArr" :key="newsIndex" :title="news.HEADLINE" :note="news.PUBDATE|formaterDay"  @click="gotoDetails(news)"></uni-list-item>
	</uni-list>
</template>

<script>
	import uniList from '@/components/uni-list/uni-list.vue'
	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
	export default {
		components: {uniList,uniListItem},
		filters:{
			formaterDay(val){
				return val.substring(0,10);
			}
		},
		data() {
			return {
				newsArr:[]
			}
		},
		methods: {
			gotoDetails(data){
				uni.navigateTo({
					url:"../newsDetails/newsDetails?current=" + JSON.stringify(data)
				})
			}
		},
		created(){
			var self = this;
			this.$request('S1014',{PAGESIZE:5,PAGENUM:1},'POST',function(res){
				console.log(res)
				if(res.data.CODE==0){
					self.newsArr = res.data.DATA;
				}
			})
		}
	}
</script>

<style>

</style>
